package com.bohua.intermediary.controller;

import com.bohua.intermediary.common.Lay;
import com.bohua.intermediary.common.Msg;
import com.bohua.intermediary.entity.SysAchievement;
import com.bohua.intermediary.service.SysAchievementService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
/**
 * 控制器
 * @author qian
 * @email 1415261159@qq.com
 * @date 2019/01/19
 */
@Controller
@RequestMapping("/sysAchievement")
public class SysAchievementController {
    @Resource
    private SysAchievementService sysAchievementService;

    @RequestMapping
    public String sysAchievement(){
        return "sysAchievement/sysAchievement";
    }
    @RequestMapping("/add")
    public String add(){
        return "sysAchievement/addSysAchievement";
    }

    @RequestMapping("/update")
    public String update(){
        return "sysAchievement/updateSysAchievement";
    }

    @RequestMapping("/getSysAchievements")
    @ResponseBody
    public Lay getSysAchievements(SysAchievement sysAchievement,Integer page,Integer limit){
        return sysAchievementService.getSysAchievements(sysAchievement,page,limit);
    }
    @RequestMapping("/addSysAchievement")
    @ResponseBody
    public Msg addSysAchievement(SysAchievement sysAchievement){
        return sysAchievementService.addSysAchievement(sysAchievement);
    }

    @RequestMapping("/updateSysAchievement")
    @ResponseBody
    public Msg updateSysAchievement(SysAchievement sysAchievement){
        return sysAchievementService.updateSysAchievement(sysAchievement);
    }

    @RequestMapping("/delSysAchievement")
    @ResponseBody
    public Msg delSysAchievement(SysAchievement sysAchievement){
        return sysAchievementService.delSysAchievement(sysAchievement);
    }
}
